﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Zhongchouwwwww.Models;

namespace Zhongchouwwwww.webform
{
    public partial class Index1 : System.Web.UI.Page
    {
        public static int Fenye = 0;
        public static List<ProjectinfoDTO> MidDate = new List<ProjectinfoDTO>();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                DateShow("全部",1);
            }
        }

        private void DateShow(string leix, int i)
        {
            GetMore.Visible = true;
            Projectitem.DataSource = null;
            ProjectTop.DataSource = null;
            var Date = BAL.GetDate.GetProjectListByType(leix, i, "", "");
            var TopDate = Date.Where(a => {
                if (a.projectid <= 74 && a.projectid >= 71)
                {
                    return true;
                }
                else
                {
                    return false;
                } }).ToList();
            MidDate = Date.Where(a => { if (a.projectid <= 74 && a.projectid >= 71)
                {
                    return false;
                }
                else
                {
                    return true;
                }}).ToList();
            ProjectTop.DataSource = TopDate;
            ProjectTop.DataBind();
            Projectitem.DataSource = MidDate.Where(a => a.projectid <=40);
            Projectitem.DataBind();
        }

        protected void GetMore_Click(object sender, EventArgs e)
        {
            GetMore.Visible = false;
            Projectitem.DataSource = null;
            Projectitem.DataSource = MidDate;
            Projectitem.DataBind();
        }
    }
}